//
//  ZhuangHuView.m
//  夺宝吧
//
//  Created by xiaocai on 15/7/23.
//  Copyright (c) 2015年 FangYuan. All rights reserved.
//

#import "ZhuangHuView.h"

@interface ZhuangHuView ()
{
    __weak IBOutlet UIButton *duobiBtn;
    __weak IBOutlet UIButton *jifenBtn;
    __weak IBOutlet UILabel *biaoshiLab;
}
@end
@implementation ZhuangHuView

- (IBAction)btnsOnClick:(UIButton *)sender {
    if (sender == duobiBtn) {
        [duobiBtn setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
        [jifenBtn setTitleColor:[UIColor grayColor] forState:UIControlStateNormal];
        [UIView animateWithDuration:0.2 animations:^{
            biaoshiLab.frame = CGRectMake(0, biaoshiLab.frame.origin.y, biaoshiLab.frame.size.width, biaoshiLab.frame.size.height);
            
        }];
        [self.father changeOffsetWithIndex:0];
    }else if (sender == jifenBtn){
        [jifenBtn setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
        [duobiBtn setTitleColor:[UIColor grayColor] forState:UIControlStateNormal];
        [UIView animateWithDuration:0.2 animations:^{
            biaoshiLab.frame = CGRectMake(WYMWITH/2, biaoshiLab.frame.origin.y, biaoshiLab.frame.size.width, biaoshiLab.frame.size.height);
        }];
        [self.father changeOffsetWithIndex:1];
    }
}

- (void)changeselectWithIndex:(NSInteger)index
{
    if (index == 0) {
        [duobiBtn setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
        [jifenBtn setTitleColor:[UIColor grayColor] forState:UIControlStateNormal];
        [UIView animateWithDuration:0.2 animations:^{
            biaoshiLab.frame = CGRectMake(0, biaoshiLab.frame.origin.y, biaoshiLab.frame.size.width, biaoshiLab.frame.size.height);
            
        }];
    }else if (index == 1){
        [jifenBtn setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
        [duobiBtn setTitleColor:[UIColor grayColor] forState:UIControlStateNormal];
        [UIView animateWithDuration:0.2 animations:^{
            biaoshiLab.frame = CGRectMake(WYMWITH/2, biaoshiLab.frame.origin.y, biaoshiLab.frame.size.width, biaoshiLab.frame.size.height);
        }];
    }

}
@end
